Skip to content

Conversation

@vhscom
Copy link
Contributor

@vhscom vhscom commented Apr 30, 2024

In support of #2212, which requires "expandable section with a summary" I found an opportunity to DRY up our codebase. This pull removes custom styling used in multiple places to produce an ExpandMore button which abstracts away the animation logic, refactors current usage in the codebase and leverages Testing Library to perform snapshot-free tests on the component, to validate its core logic and capabilities.

Screen.Recording.2024-04-30.at.1.44.08.PM.mov
Screenshot 2024-04-30 at 3 41 40 PM

</IconButton>
<ExpandMore
expand={expanded}
onClick={handleExpandClick}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expansion logic moved into handler function rather than modifying state directly.

[`& .${classes.expandOpen}`]: {
transform: 'rotate(180deg)',
transition: 'transform 0.1s linear',
marginLeft: 'auto'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is styled component logic which was being used to replicate the animated behavior of the icon.

@vhscom vhscom force-pushed the feature-2212/expand-more-component branch 3 times, most recently from 5ca1266 to 4357538 Compare April 30, 2024 19:21
@vhscom vhscom force-pushed the feature-2212/expand-more-component branch from 7c4dc96 to fa14fa5 Compare April 30, 2024 20:37
Copy link
Contributor

@S78901 S78901 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@vhscom vhscom merged commit fa14fa5 into develop Apr 30, 2024
@vhscom vhscom deleted the feature-2212/expand-more-component branch April 30, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants